package com.zhentao.utils.user;

import com.zhentao.model.common.dtos.ApUser;
import com.zhentao.model.common.wemedia.WmUser;

public class AppThreadLocalUtil {
    private final static ThreadLocal<ApUser> WM_USER_THREAD_LOCAL=new ThreadLocal<>();
    /**
     * 添加用户
     * @param
     */
    public static void  setUser(ApUser user){
        WM_USER_THREAD_LOCAL.set(user);
    }

    /**
     * 获取用户
     */
    public static ApUser getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }

    /**
     * 清理用户
     */
    public static void clear(){
        WM_USER_THREAD_LOCAL.remove();
    }
}
